application.properties file is located in src/main/resources Directory.
You can create additional Profile specific files as described in Assign Profile - To application.properties
src/main/resources (application-profile1.properties)
Properties inside application.properties file will be automatically used to configure different functionalities: DB, Port.
application.properties
# DATABASE
spring.datasource.url = jdbc:postgresql://localhost:5432/postgres
spring.datasource.username = postgres
spring.datasource.password = letmein
spring.datasource.driver-class-name = org.postgresql.Driver
# JPA / HIBERNATE
spring.jpa.hibernate.ddl-auto = create-drop
Properties inside application.properties file can be defined by using either '=' or ':'.
application.properties
messages.hello1 : Hello1 from Controller
messages.hello2 = Hello2 from Controller
You can also add additional custom Properties.
All Properties from application.properties file can be referenced from Controller or HTML.
Reference from Controller
@Value("${messages.hello1}")
private String message;
Reference from HTML
<p th:text="${@environment.getProperty('messages.hello1')}"/>